package com.nieshenkuan.cloud.config;


import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @auther nieshenkuan
 * @create
 */
@Configuration
public class RestTemplateConfig
{
    /**
     * 不加LoadBalanced 注解会报 java.net.UnknownHostException
     * @return
     */
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate()
    {
        return new RestTemplate();
    }
}
